/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once

#include "节点/节点.h"
#include <面/面.h>


class API_EXPORT C_光栅阴影渲染节点 : public C_节点基类 {
	//S_板载缓存* m_摄像机矩阵;

	S_GPU参数槽 m_摄像机GPU参数槽;
public:
	C_光栅阴影渲染节点(S_设备环境& ctx);
	~C_光栅阴影渲染节点();

	//S_Props m_加速计算方式;
	

	bool	f_update();
	void	f_异步解算();
	void	f_读取(FILE* f);
	void	f_写入(FILE* f);

};
API_EXPORT C_节点基类*	f_node_创建光栅阴影渲染节点(S_设备环境& ctx, C_节点树* 子节点树);
API_EXPORT C_节点基类*	f_node_加载光栅阴影渲染节点(S_设备环境& ctx, FILE* f);
API_EXPORT void			f_node_保存光栅阴影渲染节点(C_节点基类* n, FILE* f);




class API_EXPORT C_环境渲染节点 : public C_节点基类 {
	//S_板载缓存* m_摄像机矩阵;

	S_GPU参数槽 m_摄像机GPU参数槽;
	S_GPU参数槽 m_环境参数布局槽;
	S_GPU参数槽 m_环境后期布局槽;

	S_Surface3D* m_环境渲染层;
	//S_Surface3D* m_颜色渲染层;

	S_GPU纹理参数槽 m_纹理槽;
	S_纹理集*		m_环境纹理集;
	//S_纹理集* m_阴影纹理集;
	//S_纹理集* m_立方体阴影纹理集;

	//S_GPU内存块		m_灯光属性ID;
	//S_GPU内存块		m_区域光属性;
	//S_GPU内存块		m_区域光投影矩阵;
	S_ConstPush_AmbientBlur m_全局常量属性;

public:
	C_环境渲染节点(S_设备环境& ctx);
	~C_环境渲染节点();

	S_Props m_渲染纹理;

	S_Props m_渲染分辨率;
	S_Props m_模糊;
	S_Props m_模糊采样;

	bool	f_update();
	void	f_异步解算();
	void	f_读取(FILE* f);
	void	f_写入(FILE* f);

};
API_EXPORT C_节点基类* f_node_创建环境渲染节点(S_设备环境& ctx, C_节点树* 子节点树);
API_EXPORT C_节点基类* f_node_加载环境渲染节点(S_设备环境& ctx, FILE* f);
API_EXPORT void			f_node_保存环境渲染节点(C_节点基类* n, FILE* f);





class API_EXPORT C_光栅渲染节点 : public C_节点基类 {
	//S_板载缓存* m_摄像机矩阵;

	S_GPU参数槽 m_摄像机GPU参数槽;
	S_GPU参数槽 m_几何渲染参数槽;
	S_GPU参数槽 m_后期屏幕效果合成参数槽;
	S_GPU参数槽 m_最终渲染参数槽;


	//S_Surface3D* m_环境渲染层;
	S_Surface3D* m_几何缓存渲染层;
	S_Surface3D* m_颜色渲染层;
	
	S_GPU纹理参数槽 m_几何纹理槽;


	S_GPU纹理参数槽 m_最终渲染纹理槽;
	S_纹理集*		m_环境纹理集;
	S_纹理集*		m_屏幕后期阴影纹理集;
	S_纹理集*		m_立方体阴影纹理集;

	S_GPU纹理参数槽 m_屏幕后期效果纹理槽;
	S_纹理集*		m_屏幕后期几何纹理集;
	S_纹理集*		m_深度阴影纹理集;
	
	
	S_纹理*			m_屏幕后期合成纹理;


	S_GPU内存块		m_灯光属性ID;
	//S_GPU内存块		m_区域光属性;
	//S_GPU内存块		m_区域光投影矩阵;
	S_GlobalAtt_RasterPostCompositing m_全局纹理属性;

public:
	C_光栅渲染节点(S_设备环境& ctx);
	~C_光栅渲染节点();

	S_Props m_渲染纹理;

	S_Props m_渲染分辨率;

	S_Props m_AO深度偏移;
	S_Props m_AO半径;
	S_Props m_AO强度;
	S_Props m_AO厚度;
	S_Props m_AO采样;

	S_Props m_阴影强度;
	S_Props m_阴影采样;

	S_Props m_环境亮度;

	bool	f_update();
	void	f_异步解算();
	void	f_读取(FILE* f);
	void	f_写入(FILE* f);

};
API_EXPORT C_节点基类*	f_node_创建光栅渲染节点(S_设备环境& ctx, C_节点树* 子节点树);
API_EXPORT C_节点基类*	f_node_加载光栅渲染节点(S_设备环境& ctx, FILE* f);
API_EXPORT void			f_node_保存光栅渲染节点(C_节点基类* n, FILE* f);








